import { Button, Result } from 'antd'
import { useRequest } from 'alova/client'
import { Http } from '../../API'


const WijmoComGoods = ({ data, ModalEvent, Off }) => {
    const { send } = useRequest(params => Http({ url: 'posBuyReturnInfoUpdateReturnInfoStatus', params }), { immediate: false })

    const onDelate = () => {
        send({ uuid: data.uuid }).then(() => {
            ModalEvent.emit({ type: 'Refresh' })
            Off()
        })
    }

    return (
        <div>
            <Result
                status="warning"
                title="是否要确认已接收到退货物品?"
                extra={[
                    <Button type="primary" key="delete" size='large' onClick={onDelate}>确认收货!</Button>,
                    <Button key="cancel" size='large' onClick={Off}>取消</Button>
                ]}
            />
        </div>
    );
};

export default WijmoComGoods;